home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
BBS-Archive
/
Dev
/
GNU-SMALLTALK.lha
/
print_file_names
< prev
next >
Wrap
Text File
|
1992-02-15
|
608b
|
34 lines
#!/bin/sh
# Usage:
# print_file_names [ -d dir ] file_or_dir [ file_or_dir ... ]
#
# Prints out each of the file names given by its argument. If the
# file turns out to be a directory, the contents of that directory
# are printed. The -d flag says "print the file names relative to <dir>"
# instead of relative to the current directory. Symbolic links
# are suppressed.
if [ "$1" = "-d" ]
then
cd $2
shift 2
fi
for file
do
if [ ! -h ${file} ]
then # suppress symbolic links
echo ${file}
if [ -d ${file} ]
then # recurse
print_file_names `/bin/ls -d ${file}/*`
fi
fi
done